<% content_for :left_sidebar do  %>
    <%= render :partial => "layouts/sidebar/xiwenguanli" %>
<% end %>
<%= new_button url: new_admins_sptitle_path,name: '新建专题' %>
<table class="table table-striped">
  <thead>
    <tr>
      <th>专题编号</th>
      <th>专题名称</th>
      <th>专题图片</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <% @sptitles.each do |sptitle| %>
      <tr>
        <td><%= sptitle.id %></td>
        <td><%= sptitle.name %></td>
        <td><%= image_tag sptitle.picture %></td>
        <td>
          <%= link_to "编辑",edit_admins_sptitle_path(sptitle),:class => 'btn btn-default btn-xs' %>
          <%= link_to "删除",admins_sptitle_path(sptitle),
                      :method => :delete,
                      :data => { :confirm => '确定删除?' },
                      :class => 'btn btn-xs btn-danger' %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<div class="count">
  <%= paginate @sptitles %>
</div>
